<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1">
    <title>treeview</title>
    <META http-equiv=Content-Type content="text/html; charset=utf-8">
    <STYLE type=text/css>
    BODY {
	BACKGROUND: #799ae1; MARGIN: 0px; FONT: 12pt 宋体
}
TABLE {
	BORDER-RIGHT: 0px; BORDER-TOP: 0px; BORDER-LEFT: 0px; BORDER-BOTTOM: 0px
}
TD {
	FONT: 12px 宋体
}
IMG {
	BORDER-RIGHT: 0px; BORDER-TOP: 0px; VERTICAL-ALIGN: bottom; BORDER-LEFT: 0px; BORDER-BOTTOM: 0px
}
A {
	FONT: 13px 宋体; COLOR: #000000; TEXT-DECORATION: none
}
A:hover {
	COLOR: #003399; TEXT-DECORATION: underline
}

.sec_menu  { border-left:1px solid white; border-right:1px solid white; border-bottom:1px solid white; overflow:hidden; background:#D6DFF7; 
SCROLLBAR-ARROW-COLOR:#FFFFFF;
SCROLLBAR-FACE-COLOR:#799ae1;
SCROLLBAR-DARKSHADOW-COLOR:#CCCCCC;
SCROLLBAR-HIGHLIGHT-COLOR:#3399FF;
SCROLLBAR-3DLIGHT-COLOR:#3399FF;
SCROLLBAR-SHADOW-COLOR:#999999;
SCROLLBAR-TRACK-COLOR:#CCCCCC;


}

</STYLE>

<SCRIPT>

    function TreeView_PopulateNodeDoCallBack(context,param) {
        WebForm_DoCallback(context.data.treeViewID,param,TreeView_ProcessNodeData,context,TreeView_ProcessNodeData,false);
    }


</SCRIPT>
<script type="text/javascript">
 function relogin() {
         //parent.location="home";
         alert("hoho");
 }
</script>
</head>
<body>
    <form id="form1">
        <div>
        
         <TABLE cellSpacing=0 cellPadding=0 width="100%" align=left border=0>
         <tbody>
           <tr>
             <td valign="top">
                <TABLE cellSpacing=0 cellPadding=0 width=158 >
                  <TBODY>
                   <tr>
				     <td height=25 id=menuTitle1 background="img/title_bg_quit.gif" style=font:10pt;color=#747474;>
				        <span style="font-weight:bold;font-size:14px;">&nbsp;选择 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span>
				      </td>
				   </tr>
				   </TBODY>
				 </table>
             </td>
            </tr>
            <tr>
            <td>
            <link rel="stylesheet" href="css/demo.css" type="text/css">
			<link rel="stylesheet" href="css/zTreeStyle/zTreeStyle.css" type="text/css">
			<script type="text/javascript" src="js/jquery-1.4.4.min.js"></script>
			<script type="text/javascript" src="js/jquery.ztree.core-3.0.js"></script>
			<script type="text/javascript">
				var setting = {
					view: {
						showIcon: false
					},
					data: {
						simpleData: {
							enable: true
						}
					}/* ,
					callback: {
						onClick: co
					} */
				};
				
				var zNodes;
				function showIconForTree(treeId, treeNode) {
					return !treeNode.isParent;
				};
		
				function co() {
					alert(999);
					//$.fn.zTree.getZTreeObj("treeDemo").selectNode(this);
					//alert(this.setting.callback.onClick = alert("kkkk"));
					//alert(this.setting.data.simpleData.idKey);
					var id = $.fn.zTree.getZTreeObj("treeDemo").getSelectedNodes()[0].id;
					alert(id);
				};
				$(document).ready(function(){
					$.ajax({
			            type: "GET",
			            url: "treejson",
			            data: null,
			            dataType: "text",
			            success: function (data) {
			            	//alert(data);
			        		zNodes = eval(data);
			            	//alert(zNodes);
			        		$.fn.zTree.init($("#treeDemo"), setting, zNodes);
			            },
			            error: function (msg) {
			                alert("服务器忙，请稍后再试！！！");
			            }
			        });
					//$.fn.zTree.init($("#treeDemo"), setting, zNodes);
				});
				function co1(msg){
					alert(msg);
					var id = $.fn.zTree.getZTreeObj("treeDemo").getSelectedNodes()[0].id;
					alert(id);
					/* $.ajax({
			            type: "GET",
			            url: "airtem2",
			            data: {msg:msg},
			            dataType: "text",
			            success: function (data) {
			            	//alert(data);
			            	parent.frames["peopleFrame"].document.body.innerHTML=data;
			            },
			            error: function (msg) {
			                alert("服务器忙，请稍后再试！！！");
			            }
			        }); */
				};
				function co2(){
					$.ajax({
			            type: "GET",
			            url: "treejson",
			            data: null,
			            dataType: "text",
			            success: function (data) {
			            	//alert(data);
			            	parent.frames["peopleFrame"].document.body.innerHTML=data;
			            },
			            error: function (msg) {
			                alert("服务器忙，请稍后再试！！！");
			            }
			        });
				};
			</script>
	     	<ul id="treeDemo" class="ztree"></ul>
            </td>
            </tr>
          </tbody>
            </TABLE>
         </div>
            
    </form>
</body>
</html>

